package com.ray.monitor.thread;

import com.ray.monitor.manager.MonitorManager;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 进程监控服务
 *
 * @author LiaoYuXing-Ray
 * @version 1.0
 * @createDate 2024/5/23 10:17
 **/
@Component
public class MonitorThread {

    @Resource
    MonitorManager monitorManager;

    @Scheduled(fixedRate = 5000)
    public void onStep(){
        try {
            monitorManager.reportMonitorInfo();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
